Skip to content

RCBC-551: FIT performer - add support for CounterEq bounds type#238

Merged
DemetrisChr merged 1 commit into
couchbase:mainfrom
DemetrisChr:RCBC-551-countereq-bounds
Jul 8, 2026
Merged

RCBC-551: FIT performer - add support for CounterEq bounds type#238
DemetrisChr merged 1 commit into
couchbase:mainfrom
DemetrisChr:RCBC-551-countereq-bounds

Conversation

@DemetrisChr

@DemetrisChr DemetrisChr commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Should be merged after #237

Changes

  • Adding support for the CounterEq bounds type, where the driver effectively tells the performer when to stop executing the workload
  • Implement the SetCounter and ClearAllCounters RPCs
  • Refactored the bounds code more generally, and created classes for the bounds type that implement the same interface (#can_execute?)
  • Counters are now global at the performer-level (as required by the new spec) and represented by a Concurrent::AtomicFixnum

@DemetrisChr
DemetrisChr force-pushed the RCBC-551-countereq-bounds branch from e1e17ed to 67243c3 Compare July 3, 2026 16:10
@DemetrisChr
DemetrisChr marked this pull request as ready for review July 3, 2026 16:13
@DemetrisChr
DemetrisChr force-pushed the RCBC-551-countereq-bounds branch from 67243c3 to 1e1cea6 Compare July 7, 2026 16:45
@DemetrisChr
DemetrisChr requested review from avsej and Copilot July 7, 2026 16:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the FIT performer to support the new counter_eq bounds type (where the driver can signal a workload to stop by mutating a shared counter), introduces performer-global counters, and wires in the new setCounter / clearAllCounters RPCs. It also refactors workload bounds handling into dedicated bounds classes implementing a common #can_execute? interface.

Changes:

  • Refactor bounds evaluation into FIT::Performer::Bounds::* classes and update workloads to loop on @bounds.can_execute?.
  • Introduce performer-global counters backed by Concurrent::AtomicFixnum, plus setCounter / clearAllCounters service endpoints.
  • Thread executor and workload construction updated to pass a shared counters container into workloads.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
fit-performer/lib/fit/performer/workloads/sdk_workload.rb Updates execution loop to rely on @bounds.can_execute? and adjusts signatures to accept global counters at init.
fit-performer/lib/fit/performer/workloads/base_workload.rb Creates bounds object during workload initialization (now requires bounds module).
fit-performer/lib/fit/performer/workloads.rb Passes the global counters container through workload construction.
fit-performer/lib/fit/performer/service.rb Adds global counters lifecycle plus set_counter / clear_all_counters RPC implementations.
fit-performer/lib/fit/performer/multi_thread_executor.rb Passes shared counters to workloads and simplifies workload invocation to execute(results).
fit-performer/lib/fit/performer/counters.rb New thread-safe counters container (currently has a deadlock issue in set_counter_value).
fit-performer/lib/fit/performer/bounds.rb New bounds factory (currently incorrectly reads counter_eq using counter).
fit-performer/lib/fit/performer/bounds/simple.rb New “run once through commands” bounds implementation.
fit-performer/lib/fit/performer/bounds/for_time.rb New time-based bounds implementation.
fit-performer/lib/fit/performer/bounds/counter.rb New counter-decrement bounds implementation (minor doc typo).
fit-performer/lib/fit/performer/bounds/counter_equality.rb New counter-equality bounds implementation (baseline semantics likely need alignment with proto initial value).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread fit-performer/lib/fit/performer/counters.rb
Comment thread fit-performer/lib/fit/performer/counters.rb Outdated
Comment thread fit-performer/lib/fit/performer/bounds.rb
Comment thread fit-performer/lib/fit/performer/bounds/counter_equality.rb Outdated
Comment thread fit-performer/lib/fit/performer/workloads/base_workload.rb Outdated
Comment thread fit-performer/lib/fit/performer/bounds/counter.rb Outdated
@DemetrisChr
DemetrisChr marked this pull request as draft July 7, 2026 16:59
@DemetrisChr
DemetrisChr force-pushed the RCBC-551-countereq-bounds branch from 1e1cea6 to 09b4a40 Compare July 7, 2026 17:08
@DemetrisChr
DemetrisChr marked this pull request as ready for review July 7, 2026 17:08
@DemetrisChr
DemetrisChr requested a review from Copilot July 7, 2026 17:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Comment thread fit-performer/lib/fit/performer/counters.rb
Comment thread fit-performer/lib/fit/performer/service.rb
Comment thread fit-performer/lib/fit/performer/bounds.rb
Comment thread fit-performer/lib/fit/performer/counters.rb
@DemetrisChr
DemetrisChr merged commit 74b810e into couchbase:main Jul 8, 2026
42 of 45 checks passed
@DemetrisChr
DemetrisChr deleted the RCBC-551-countereq-bounds branch July 8, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants